import 'package:flutter/material.dart';
import 'package:xianyu_school/xianyuApp/mine/myBoughtPage.dart';
import 'package:xianyu_school/xianyuApp/mine/myCollectedGoodsPage.dart';
import '../myBroseHisPage.dart';
import 'mineItem.dart';

class mineBuy extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(horizontal: 14),
      child: Container(
        padding: EdgeInsets.all(10),
        decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(20)
        ),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Row(
              children: [
                Text(
                    "买在闲鱼",
                    style: TextStyle(
                        color: Colors.black,
                        fontSize: 16
                    )
                ),
                SizedBox(
                  width: 4,
                ),
                Text(
                    "在闲鱼赚了1867.00元",
                    style: TextStyle(
                        color: Colors.grey,
                        fontSize: 14
                    )
                ),
              ],
            ),

            SizedBox(
              height: 16,
            ),

            // grid
            GridView.count(
              physics: NeverScrollableScrollPhysics(),
              crossAxisCount: 3,
              crossAxisSpacing: 10,
              shrinkWrap: true,
              childAspectRatio: 1.5,
              padding: EdgeInsets.all(0),
              children: [
                GestureDetector(
                  child: mineItem(image: "lib/xianyuApp/imgs/bought.png", title: "我买到的 21"),
                  onTap: (){
                    Navigator.push(context, MaterialPageRoute(builder: (_){
                      return myBoughtPage();
                    }));
                  },
                ),
                GestureDetector(
                  child: mineItem(image: "lib/xianyuApp/imgs/shoucang.png", title: "我收藏的 0"),
                  onTap: (){
                    Navigator.push(context, MaterialPageRoute(builder: (_){
                      return myCollectedGoodsPage();
                    }));
                  },
                ),
                GestureDetector(
                  child: mineItem(image: "lib/xianyuApp/imgs/browsinghistory.png", title: "浏览历史 0"),
                  onTap: (){
                    Navigator.push(context, MaterialPageRoute(builder: (_){
                      return myBroseHisPage();
                    }));
                  },
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}